#include "disp_task.h"

char hmi_speed[]="n1.txt";//测速
char hmi_yaw[]="n2.txt";//测角度
char hmi_trace[]="n3.txt";//测循迹
char hmi_totol[]="n4.txt";//测里程
char hmi_imu[]="n5.txt";//测记忆角度
char data_HMI[]="";//串口屏数据存储空间

void HMI_proc(){
    int_to_binary_string(Trace_Byte, data_HMI, 8);
    HMI_send_string(hmi_trace, data_HMI);//串口屏打印循迹状态

    float_to_string(Yaw,data_HMI,8);
    HMI_send_string(hmi_yaw, data_HMI);//串口屏打印陀螺仪实际的Yaw角度

    float_to_string(M_Speed_L,data_HMI,8);
    HMI_send_string(hmi_speed, data_HMI);//串口屏打印速度

    float_to_string(System_Mode,data_HMI,8);
    HMI_send_string(hmi_imu, data_HMI);//串口屏打印单片机记忆的Yaw角度

    float_to_string(NEncoder.right_motor_total_cnt,data_HMI,8);
    HMI_send_string(hmi_totol, data_HMI);//串口屏打印总的脉冲数
}       

void oled_proc(){
    OLED_Sprintf(0, "Mode: %d ", System_Mode + 1); // 显示模式
    OLED_Sprintf(1, "LX State: %08X", Trace_Byte);  // 显示 LX_state 的二进制形式
    OLED_Sprintf(2, "Tick: %d", (int)TIL_GetTick()); // 显示 TIL_GetTick()
    OLED_Sprintf(3, "Yaw: %d", Yaw); // 显示 Yaw 值
    OLED_Update();
}

void disp_proc(){
    oled_proc();
}
